package com.victualler.business.inventory.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.victualler.core.base.dao.BaseOrderDao;
import com.victualler.core.common.annotation.InitEditColumn;
import com.victualler.core.common.annotation.ListShowColumn;
import com.victualler.core.common.enums.ColumnFormatEnum;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @author Guoshichang
 * @since 15:58 on 2018/10/5.
 * @Function 库存变更单表 记录所有商品库存内容变动的轨迹信息 视角以库存管理员/仓库 为主维度  发起的相关操作 , 包括入库确认 , 出库确认等
 *          只有此单审核通过才会发生实际的商品库存的变更
 */
@Entity
@Table(name="inventory_order")
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
public class InventoryOrderDao extends BaseOrderDao implements Serializable {

    /**关联前置单号 */
    @ListShowColumn(title = "订单号",sort = 1,type = ColumnFormatEnum.LINK)
    @InitEditColumn(title = "订单号",sort = 1,canEdit = false,required = false)
    public String orderNo;
    /**操作仓库id*/
    private Long depotId;
    /**操作仓库名称*/
    @ListShowColumn(title = "仓库",sort = 2)
    private String depotName;
    /**库存类型 出库 入库*/
    @ListShowColumn(title = "类型",sort = 3,type = ColumnFormatEnum.DICT,dictCodeType = "StorageType")
    @InitEditColumn(title = "类型",sort = 3,type = ColumnFormatEnum.DICT,dictCodeType = "StorageType")
    public String storageType;
    /**订单总量*/
    @ListShowColumn(title = "总量",sort = 4)
    @InitEditColumn(title = "总量",sort = 4,canEdit = false)
    private BigDecimal sumQuantity;
    /**备注*/
    @ListShowColumn(title = "备注",sort = 5)
    @InitEditColumn(title = "备注",sort = 5)
    private String reason;



    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getDepotName() {
        return depotName;
    }

    public void setDepotName(String depotName) {
        this.depotName = depotName;
    }

    public Long getDepotId() {
        return depotId;
    }

    public void setDepotId(Long depotId) {
        this.depotId = depotId;
    }



    public BigDecimal getSumQuantity() {
        return sumQuantity;
    }

    public void setSumQuantity(BigDecimal sumQuantity) {
        this.sumQuantity = sumQuantity;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getStorageType() {
        return storageType;
    }

    public void setStorageType(String storageType) {
        this.storageType = storageType;
    }
}
